Nested ternary operator in c programming